|
|
|
| TABLE 15.7. THE PICTUREBOX CONTROLS AND PROPERTY SETTINGS. | | Control | Property | Value | | PictureBox | Name | picDisplay | | OLEDropMode | Manual | | Borderstyle | 0-None | | Height | 330 | | Width | 360 | | Top | 60 | | PictureBox | Name | picDelete | | OLEDropMode | Manual | | Borderstyle | 0-None | | Height | 330 | | Width | 360 | | Top | 60 | | PictureBox | Name | picPrint | | OLEDropMode | Manual | | Borderstyle | 0-None | | Height | 330 | | Width | 360 | | Top | 60 |
|
|
|
|
|
|
Choose the pictures you want to represent the three functions. In addition, you need to set the TreeView control's OLEDRAGMODE property to Automatic to enable the addition of code to start the drag process. After you have done this, the only step remaining is to add the code that will place the selected names record key into the DataObject when the drag process is started, and then when the data is dropped, the PictureBox that it was dropped on will retrieve the record key and perform the operation specified for that PictureBox (such as display, delete, or print). The code in Listing 15.5 performs the action for the display event. |
|
|
|
|
|
|
|
|
LISTING 15.5 ADDRESSDRAG.TXTSETTING THE DRAG OPERATION FOR THE ADDRESS BOOK APPLICATION. |
|
|
|
 |
|
|
|
|
1: Private Sub tvTreeView_OLEStartDrag(Data As ComctlLib.DataObject,_
2: AllowedEffects As Long)
3: Data.SetData tvTreeView.SelectedItem.Key
4: End Sub
|
|
|
|
|
|